import Vue from 'vue'

import VueRouter from 'vue-router'
import login from '../views/login.vue'

import layout from '../views/layout/layout.vue'

import business from '../views/layout/business/business.vue'
import chart from '../views/layout/chart/chart.vue'
import questiong from '../views/layout/questiong/questiong.vue'
import subject from '../views/layout/subject/subject.vue'
import user from '../views/layout/user/user.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      component: login
    },
    {
      path: '/layout',
      component: layout,
      redirect: '/layout/subject',
      children: [
        {
          path: '/layout/business',
          component: business
        },
        {
          path: '/layout/chart',
          component: chart
        },
        {
          path: '/layout/questiong',
          component: questiong
        },
        {
          path: '/layout/subject',
          component: subject
        },
        {
          path: '/layout/user',
          component: user
        }
      ]
    }
  ]
})

export default router
